from selenium.webdriver.common.by import By

from utils.webdriver_factory import WebDriverFactory
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support.expected_conditions import *

driver = WebDriverFactory.get_instance()


# 演示截屏

def launch():
    driver.get('http://www.baidu.com')
    WebDriverWait(driver, 5, 1).until(visibility_of(driver.find_element(By.ID, 'kw')), '输入框未找到')
    driver.get_screenshot_as_file('../img/1.png')


if __name__ == '__main__':
    launch()
